import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history:createWebHistory(),
  //滚动行为
  // scrollBehavior(to, from, savedPosition) {
  //   return { top: 0 }
  // },
  routes:[
    {
      path:'/',
      redirect:'/home',
    },
    {
      path:'/home',
      name:'home',
      component:()=>import('@/views/home/index.vue'),
      redirect:'/home/Detail',
      children:[
        {
          path:'/home/Detail',
          name:'detail',
          component:()=>import('@/views/home/Detail/index.vue')
        },
        {
          //预约挂号
          path:'/home/Registration',
          name:'registration',
         component:()=>import('@/views/home/Registration/index.vue') 
        },
        {
          //预约须知
          path:'/home/Notice',
          name:'notice',
          component:()=>import('@/views/home/Notice/index.vue')
        },
        {
          //停诊信息
          path:'/home/Stop',
          name:'stop',
          component:()=>import('@/views/home/stop/index.vue')
        },
        {
          //查询
          path:'/home/Search',
          name:'search',
          component:()=>import('@/views/home/Search/index.vue')
        }
      ]
    },
    {
      path:'/user',
      name:'user',
      component:()=>import('@/views/user/index.vue'),
      redirect:'/user/authentication',
      children:[
        {
          path:'/user/authentication',
          name:'authentication',
          component:()=>import('@/views/user/authentication/index.vue')
        },
        {
          path:'/user/orders',
          name:'orders',
          component:()=>import('@/views/user/orders/index.vue')
        },
        {
          path:'/user/manage',
          name:'manage',
          component:()=>import('@/views/user/manage/index.vue')
        },
        {
          path:'/user/Account',
          name:'Account',
          component:()=>import('@/views/user/Account/index.vue')
        },
        {
          path:'/user/Feedback',
          name:'Feedback',
          component:()=>import('@/views/user/Feedback/index.vue')
        },
        {
          path:'/user/RegistrationSetup',
          name:'RegistrationSetup',
          component:()=>import('@/views/user/orders/Registrations_setup/index.vue')
        },
        {
          path:'/user/Detail',
          name:'Detail',
          component:()=>import('@/views/user/detail/index.vue')
        }

      ]
    }
  ]
})

export default router
